Manages the components within nkWinUi. More...
Public Member Functions | |
Component * | createOrRetrieve (const nkMemory::StringView &name, COMPONENT_TYPE componentType) |
Component * | get (const nkMemory::StringView &name) const |
Component * | getByIndex (unsigned int index) const |
void | erase (const nkMemory::StringView &name) |
Manages the components within nkWinUi.
Responsible for creating and book-keeping them. At all time, the manager is responsible for the memory allocated inside it.
Component* nkWinUi::ComponentManager::createOrRetrieve | ( | const nkMemory::StringView & | name, |
COMPONENT_TYPE | componentType | ||
) |
Creates (if unavailable) or retrieves (if available) component attached to passed name.
name | The name, aka identifier, of the component to create or retrieve. |
componentType | The type the component should be. |
Component* nkWinUi::ComponentManager::get | ( | const nkMemory::StringView & | name | ) | const |
Returns a component attached to a name, if available.
name | The name of the component that should be retrieved. |
Component* nkWinUi::ComponentManager::getByIndex | ( | unsigned int | index | ) | const |
Returns the component at given index, if available.
index | The index of the component to retrieve. |
void nkWinUi::ComponentManager::erase | ( | const nkMemory::StringView & | name | ) |
Erases a component. Memory attached to it will be freed.
name | The name identifying the component to erase. |